|
Repetier-Firmware
1.0.0
|
#include <avr/io.h>Go to the source code of this file.
Macros | |
| #define | MASK(PIN) (1 << PIN) |
MASKING- returns . More... | |
| #define | _READ(IO) ((bool)(DIO ## IO ## _RPORT & MASK(DIO ## IO ## _PIN))) |
| Read a pin. More... | |
| #define | _WRITE(IO, v) do { if (v) {DIO ## IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0) |
| write to a pin More... | |
| #define | _TOGGLE(IO) do {DIO ## IO ## _RPORT = MASK(DIO ## IO ## _PIN); } while (0) |
| toggle a pin More... | |
| #define | _SET_INPUT(IO) do {DIO ## IO ## _DDR &= ~MASK(DIO ## IO ## _PIN); } while (0) |
| set pin as input More... | |
| #define | _SET_OUTPUT(IO) do {DIO ## IO ## _DDR |= MASK(DIO ## IO ## _PIN); } while (0) |
| set pin as output More... | |
| #define | _GET_INPUT(IO) ((DIO ## IO ## _DDR & MASK(DIO ## IO ## _PIN)) == 0) |
| check if pin is an input More... | |
| #define | _GET_OUTPUT(IO) ((DIO ## IO ## _DDR & MASK(DIO ## IO ## _PIN)) != 0) |
| check if pin is an output More... | |
| #define | READ(IO) _READ(IO) |
| Read a pin wrapper. More... | |
| #define | WRITE(IO, v) _WRITE(IO, v) |
| Write to a pin wrapper. More... | |
| #define | PULLUP(IO, v) _WRITE(IO, v) |
| #define | TOGGLE(IO) _TOGGLE(IO) |
| toggle a pin wrapper More... | |
| #define | SET_INPUT(IO) _SET_INPUT(IO) |
| set pin as input wrapper More... | |
| #define | SET_OUTPUT(IO) _SET_OUTPUT(IO) |
| set pin as output wrapper More... | |
| #define | GET_INPUT(IO) _GET_INPUT(IO) |
| check if pin is an input wrapper More... | |
| #define | GET_OUTPUT(IO) _GET_OUTPUT(IO) |
| check if pin is an output wrapper More... | |
| #define _GET_INPUT | ( | IO | ) | ((DIO ## IO ## _DDR & MASK(DIO ## IO ## _PIN)) == 0) |
check if pin is an input
| #define _GET_OUTPUT | ( | IO | ) | ((DIO ## IO ## _DDR & MASK(DIO ## IO ## _PIN)) != 0) |
check if pin is an output
| #define _READ | ( | IO | ) | ((bool)(DIO ## IO ## _RPORT & MASK(DIO ## IO ## _PIN))) |
Read a pin.
| #define _SET_INPUT | ( | IO | ) | do {DIO ## IO ## _DDR &= ~MASK(DIO ## IO ## _PIN); } while (0) |
set pin as input
| #define _SET_OUTPUT | ( | IO | ) | do {DIO ## IO ## _DDR |= MASK(DIO ## IO ## _PIN); } while (0) |
set pin as output
| #define _TOGGLE | ( | IO | ) | do {DIO ## IO ## _RPORT = MASK(DIO ## IO ## _PIN); } while (0) |
toggle a pin
| #define _WRITE | ( | IO, | |
| v | |||
| ) | do { if (v) {DIO ## IO ## _WPORT |= MASK(DIO ## IO ## _PIN); } else {DIO ## IO ## _WPORT &= ~MASK(DIO ## IO ## _PIN); }; } while (0) |
write to a pin
| #define GET_INPUT | ( | IO | ) | _GET_INPUT(IO) |
check if pin is an input wrapper
| #define GET_OUTPUT | ( | IO | ) | _GET_OUTPUT(IO) |
check if pin is an output wrapper
| #define MASK | ( | PIN | ) | (1 << PIN) |
MASKING- returns
.
| #define PULLUP | ( | IO, | |
| v | |||
| ) | _WRITE(IO, v) |
| #define READ | ( | IO | ) | _READ(IO) |
Read a pin wrapper.
| #define SET_INPUT | ( | IO | ) | _SET_INPUT(IO) |
set pin as input wrapper
| #define SET_OUTPUT | ( | IO | ) | _SET_OUTPUT(IO) |
set pin as output wrapper
| #define TOGGLE | ( | IO | ) | _TOGGLE(IO) |
toggle a pin wrapper
| #define WRITE | ( | IO, | |
| v | |||
| ) | _WRITE(IO, v) |
Write to a pin wrapper.